const { FusesPlugin } = require('@electron-forge/plugin-fuses');
const { FuseV1Options, FuseVersion } = require('@electron/fuses');

module.exports = {
  packagerConfig: {
    asar: false,
    name: 'Cloud Bucket Uploader',
    executableName: 'cloud-bucket-uploader',
    appBundleId: 'com.clouduploader.app',
    appVersion: '1.0.0',
    buildVersion: '1.0.0',
    appCopyright: 'Copyright © 2024',
    win32metadata: {
      CompanyName: 'Cloud Uploader',
      FileDescription: 'Cloud Bucket Resource Upload Tool',
      OriginalFilename: 'cloud-bucket-uploader.exe',
      ProductName: 'Cloud Bucket Uploader',
      InternalName: 'cloud-bucket-uploader'
    }
  },
  rebuildConfig: {},
  makers: [
    {
      name: '@electron-forge/maker-squirrel',
      config: {
        name: 'cloud-bucket-uploader'
      },
    },
    {
      name: '@electron-forge/maker-zip',
      platforms: ['darwin'],
    },
    {
      name: '@electron-forge/maker-deb',
      config: {
        options: {
          maintainer: 'Cloud Uploader',
          homepage: 'https://github.com/clouduploader/app'
        }
      },
    },
    {
      name: '@electron-forge/maker-rpm',
      config: {
        options: {
          maintainer: 'Cloud Uploader',
          homepage: 'https://github.com/clouduploader/app'
        }
      },
    },
  ],
  plugins: [
    // Fuses are used to enable/disable various Electron functionality
    // at package time, before code signing the application
    new FusesPlugin({
      version: FuseVersion.V1,
      [FuseV1Options.RunAsNode]: false,
      [FuseV1Options.EnableCookieEncryption]: true,
      [FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
      [FuseV1Options.EnableNodeCliInspectArguments]: false,
      [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: false,
      [FuseV1Options.OnlyLoadAppFromAsar]: false,
    }),
  ],
};